from airtest.core.api import *
from basic.UIParent import UIParent
from basic.utils.asserts import asserts
from commen.page.ann.sharePage import sharePage

class ShareCase(UIParent):

    # @classmethod
    # def test_two(self):
    #     IndexPage.clickSearch();
    #     keyevent("BACK")

    @classmethod
    def test_01shareCheck(self):
        '''分享弹窗、选项显示校验'''

        ##分享
        sharePage.clickmyBtn()
        sharePage.clickShare()

        r = sharePage.shareCheck()
        assert_equal(r, False, "分享未弹出")
        if not r:
            listText = sharePage.getShare()
            a = False
            if len(listText) == 4:
                a = True
            assert_equal(a, True, "分享异常")

    @classmethod
    def test_02wechatCheck(self):
        '''点击微信分享跳转校验'''
        sharePage.clickmyBtn()
        sharePage.clickShare()
        sharePage.clickWechat()
        sleep(3)
        wechatText = sharePage.getWechatText()
        asserts.equal("登录微信", wechatText, "点击微信分享跳转校验")
        stop_app("com.tencent.mm")


